package mc

import (
	"gitee.com/dreamwood/ez-go/db/mgo"
)

const (
	SubjectEventNew          = "study.SubjectNew"
	SubjectEventBeforeCreate = "study.SubjectBeforeCreate"
	SubjectEventBeforeUpdate = "study.SubjectBeforeUpdate"
	SubjectEventBeforeSave   = "study.SubjectBeforeCreate study.SubjectBeforeUpdate"
	SubjectEventAfterCreate  = "study.SubjectAfterCreate"
	SubjectEventAfterUpdate  = "study.SubjectAfterUpdate"
	SubjectEventAfterSave    = "study.SubjectAfterCreate study.SubjectAfterUpdate"
	SubjectEventDelete       = "study.SubjectDelete"

	SubjectAccessControlEvent = "study.SubjectAccessControl"
)

func GetSubjectConfig() *mgo.DocConfig {
	return Subject_Config
}

var Subject_Config *mgo.DocConfig

func init() {
	Subject_Config = NewSubjectConfig()
}

func NewSubjectConfig() *mgo.DocConfig {
	return &mgo.DocConfig{
		ContainerKey: "study.Subject",
		Fields: []string{
			"name",
		},
		RelationFields:  []string{},
		RelationConfigs: map[string]*mgo.DocRelation{},
		FieldFilter: map[string]*mgo.DocFieldFilter{
			"default": {
				Select: []string{},
				Omit:   []string{},
			},
		},
	}
}
